//
//  NSMutableObject+SafeInsert.h
//  Amily
//
//  Created by "" on 15/1/5.
//  Copyright (c) 2015年 Amily. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSMutableDictionary (SafeInsert)

-(void) safeSetObject:(id)anObject forKey:(id)aKey;
-(void) safeRemoveObjectForKey:(id)aKey;

@end

@interface NSMutableSet (SafeInsert)

-(void) safeAddObject:(id)object;
- (void) safeRemoveObject:(id)object;

@end

@interface NSMutableArray (SafeInsert)

-(void) safeAddObject:(id)anObject;
-(void) safeInsertObject:(id)anObject atIndex:(NSUInteger)index;
-(void) safeRemoveObjectAtIndex:(NSUInteger)index;
-(void) safeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject;
-(id) firstObject;
-(void) removeFirstObject;

@end

@interface NSArray (SafeInsert)

-(id) firstObject;

@end

@interface NSCache (SafeInsert)
-(void) safeSetObject:(id)anObject forKey:(id)aKey;
-(void) safeRemoveObjectForKey:(id)aKey;
@end

@interface NSMutableString (SafeInsert)

- (void)safeAppendString:(NSString *)aString;

@end